JPanel 클래스

✒️ 2025-05-15 14:22 내용 수정



JPanel 인스턴스이름 = new JPanel();
JPanel 인스턴스이름 = new JPanel(LayoutManager layout);
JPanel 인스턴스이름 = new JPanel(boolean isDoubleBuffered);
JPanel 인스턴스이름 = new JPanel(LayoutManager layout, boolean isDoubleBuffered);
메서드 설명
setLocation(int a, int b) x=a, y=b 위치에 패널이 표시될 위치 설정
setSize(int a, int b) x=a, y=b 크기의 패널 설정
setVisible(true) 패널을 보이게 할지 결정
setBackground(Color bgColor) 패널의 배경 색을 적용
Component add(Component c) 특정 Component를 container에 추가
setLayout(LayoutManager mgr) Layout Manager를 설정
setBounds(int x, int y, int width, int height) Component의 위치와 크기를 원하는대로 지정